<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
	<title>Document</title>
	<script type="text/javascript" src="{:WEB_URL}public/static/js/vue.min.js"></script>
	<script type="text/javascript" src="{:WEB_URL}public/static/js/jquery-1.11.0.js"></script>
	<link rel="stylesheet" href="{:WEB_URL}public/static/layui/css/layui.css" />
	<script type="text/javascript" src="{:WEB_URL}public/static/layui/layui.js"></script>
</head>
<style type="text/css">
	.login-box{
		width:100%;
		margin-top:200px;
		text-align: center;
	}
	.login-confirm{
		padding:10%;
	}
	.wxf-btn{
		width: 100%;
		display: block;
	}
</style>
<body>
	<div class="login-box">
		<input type="hidden" id="token" value="{$token}" />
		<input type="hidden" id="username" value="admin" />
		<div class="login-confirm">
			<button type="button" @click="onsubmit()" class="layui-btn wxf-btn">
				确认登录
			</button>
		</div>
	</div>
	<script type="text/javascript">
	var vm = new Vue({
		el : '.login-box',
		data:{
		},
		methods:{
			onsubmit:function(){
				layer.confirm('是否确认立即登录？',function(){
					var token = $('#token').val();
					var username = $('#username').val();
					var data = {};
					data.token = token;
					data.username = username;
					$.post("{:url('/index/publics/confirm')}",data,function(ret){
						if (ret.code == 0) {
							layer.msg(ret.msg,function(){
								window.location.href=ret.data.url;
							});
						}else{
							layer.msg(ret.msg);
						}
					});
				});
			},
		},
	});

	//引入layui
	layui.use(['form'],function(){
		var form = layui.form;
		form.render();
	});
	</script>
</body>
</html>